#pragma once

#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <math.h>

extern FILE * fp;

struct RiffChunk{
    char chunkID[4];
    int32_t chunkSize;
    char format[4];
};

struct FmtChunk{
    char chunkID[4];
    int32_t chunkSize;
    int16_t audioFormat;
    int16_t numChannels;
    int32_t sampleRate;
    int32_t byteRate;
    int16_t blockAlign;
    int16_t bitsPerSample;
};

struct DataChunk{
    char chunkID[4];
    int32_t chunkSize;
};

void moveForward(char *);

void readChunk(struct RiffChunk *);

void printChunk(struct RiffChunk *);

void readSubchunk1(struct FmtChunk *);

void printSubchunk1(struct FmtChunk *);

void readSubchunk2(struct DataChunk *);

void printSubchunk2(struct DataChunk *, int, int, int, int, double, double);











